package com.xc.hotelmgr.webapi.modules.op.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xc.hotelmgr.webapi.common.utils.PageUtils;
import com.xc.hotelmgr.webapi.common.utils.Query;

import com.xc.hotelmgr.webapi.modules.op.dao.TaskDetailDao;
import com.xc.hotelmgr.webapi.modules.op.entity.TaskDetailEntity;
import com.xc.hotelmgr.webapi.modules.op.service.TaskDetailService;


@Service("taskDetailService")
public class TaskDetailServiceImpl extends ServiceImpl<TaskDetailDao, TaskDetailEntity> implements TaskDetailService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TaskDetailEntity> page = this.page(
                new Query<TaskDetailEntity>().getPage(params),
                new QueryWrapper<TaskDetailEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils sqlQueryPage(Map<String, Object> params) {
        String taskId = (String) params.get("taskId");
         IPage<TaskDetailEntity> page = new Query<TaskDetailEntity>().getPage(params);
        List<TaskDetailEntity> list =  baseMapper.sqlQueryPage(page,taskId);
        return new PageUtils(page,list);
    }

    @Override
    public void clearTaskDetail() {
        baseMapper.clearTaskDetail();
    }

}